package day11;

//本类是用来测试final的演示demo
public class Test03 {
    public static void main(String[] args) {
        Son s=new Son();
        System.out.println(s.a+=1);
        s.eat();
        System.out.println();
    }


}

//被final修饰的类不能继承
//final
class Father {
    public void eat() {
        System.out.println("eat");
    }

}

class Son extends Father {
    @Override
    public void eat() {
        System.out.println("so eat");
        final int B=100;//常量

        System.out.println(B);

    }

    int a = 10;

}